﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace FirstGame
{
    public abstract class MenuScreen : GameScreen
    {
        protected Texture2D _Background;

        protected Texture2D Background
        {
            get { return _Background; }
            set { _Background = value; }
        }


        protected List<MenuItem> _Items;

        public List<MenuItem> Items
        {
            get { return _Items; }
            set { _Items = value; }
        }

        protected int _nItems;

        protected int NItems
        {
            get { return _nItems; }
            set { _nItems = value; }
        }

        public override void Update(GameTime gameTime, InputSystem input)
        {
            for (int i = 0; i < _nItems; i++)
            {
                Items[i].Update(gameTime, input);
            }
            base.Update(gameTime, input);

        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {

            spriteBatch.Draw(Background, new Rectangle(0, 0,
                                           800, 480),
                                            new Color(255,255,255,ScreenAlpha));
            

            for (int i = 0; i < _nItems; i++)
            {
                Items[i].Draw(gameTime, spriteBatch);
            }

            //base.Draw(gameTime, spriteBatch);
        }
    }
}
